<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
<title>{{$pageTitle}}-{{$site[title]}}</title>
<meta NAME="ROBOTS" CONTENT="INDEX,FOLLOW">
<meta name="Keywords" content="{{if $seokeywords}}{{$seokeywords}}{{else}}{{$site[seokeywords]}}{{/if}}" />
<meta name="Description" content="{{if $seodescription}}{{$seodescription}}{{else}}{{$site[seodescription]}}{{/if}}" />
<meta property="qc:admins" content="23432764476522076741563757" />
<!--[if lt IE 9]>
	{{$this->Html->script(array('html5shiv.js','respond.min.js'))}}
<![endif]-->
{{$this->Html->meta('icon')}}

<link href="/css/bootstrap_2.css" rel="stylesheet" type="text/css" >
{{$this->Html->css(array('font-awesome.min.css','135.css','jquery.jgrowl.css','ui-customer'))}}

{{$this->Html->script(array(
            'jquery/jquery.min.js',
            'jquery/jquery.cookie.js',        
            'i18n/language-zh-cn.js',
            'bootstrap.min.js',
            'jquery/jquery.jgrowl.min.js',
            'common.js','front.js',
            
        ));
}}

<style>
{{if Configure::read('Page.extracss') }}
	{{Configure::read('Page.extracss')}}
{{/if}}
body{min-width: 1200px;background: #e7e8eb;color:#222;font-size: 16px;}
.breadcrumb a{color:#666;}
.btn-primary{background-color: #44b549;border-color:#44b549;}
.btn-primary:hover {background-color: #2f9833;}
.ui-widget-header, .table thead, div.dataTables_wrapper{background-color:#f4f5f9;color: #222;}
.alert-info {background-color: #f4f5f9;border-color: #e7e7eb;color: #8d8d8d;}
.table > thead > tr > th{border-bottom: 0 none;}
.table > thead:first-child > tr:first-child > th{border-top: 1px solid #dddddd;}
</style>

<!--[if lte IE 8]>
{{$this->Html->css(array(	
	'bootstrap-ie6.css',
))}}
{{$this->Html->script(array('jquery/jquery-migrate-1.2.1.min.js'))}}
<![endif]-->

{{if !empty($_SESSION['Auth']['Staff']) }}
<!-- 当为后台登陆后，才加载jquery ui，与模板编辑的js -->
{{$this->Html->css(array('edit_template',))}}
	
{{$this->Html->script(array(			
            'jquery/jquery-ui-1.10.3.custom.min.js',           
            'portlet.js', 
            'bootstrap-colorpicker.min.js',   
            'ckeditor/ckeditor.js',
            'jquery/validator.js',
            'swfupload/swfupload.js',
            'swfupload/swfupload.queue.js',
			'swfupload/swfupload.cookies.js',
            'swfupload/fileprogress.js',
            'swfupload/handlers.js',       
        ));
}}
<script type="text/javascript">

var viewFileName = "{{$viewfile_for_layout}}";
var current_controller = "{{$current_controller}}";
var current_model = "{{$current_model}}";
var current_url = "{{$current_model}}";
var current_action = "{{$current_action}}";
var current_pass = "{{implode('/',$current_pass)}}";
</script>
{{/if}}
<script type="text/javascript">
var BASEURL = "{{APP_SUB_DIR}}";
var ADMIN_BASEURL = BASEURL+"/manage";
</script>
</head>
<body>

<header id="top" class="header">
            <nav role="navigation" class="navbar">
                <div class="container">
                    <div class="row">
                        <div class="col-md-12">
                            <!-- Navbar-Header -->
                            <div class="navbar-header">
                                <!-- Text-Logo -->
                                <a title="135编辑器，操作简单才是硬道理" class="navbar-brand scrollto" href="/">
                                    <img src="http://qdn.135editor.com/135editor/tpl/logo2.png" alt="135编辑器" style="height:32px;">
                                </a>
                            </div><!-- /End Navbar-Header -->
                            
                            <ul class="nav navbar-nav navbar-right">
      	{{if (!empty($CurrentUser))}}
      		
      		<li><a href="{{$this->Html->url('/shortmessages/mine')}}" target="_blank" data-toggle="tooltip" data-container="body" data-placement="bottom" title="站内消息中心"><i class="fa fa-bell"></i><span  class="user-unread-msgnum">0</span></a></li>
			
      		<li id="vip-user-icon" {{if !is_array($CurrentUser['role_id']) || max($CurrentUser['role_id'])<=2}}style="display:none;"{{/if}}><a href="{{$this->Html->url('/users/permission')}}" target="_blank" data-toggle="tooltip" data-container="body" data-placement="bottom" title="Vip会员,点击查看权限"><img src="/img/icons/vip.png"></a></li>
			
			<li class="dropdown">
				 {{$this->Html->link($CurrentUser['username'].'<b class="caret"></b>', '#', array('title' => 'view your account',"class"=>"dropdown-toggle","data-toggle"=>"dropdown",'escape'=>false)); }}
				 <ul class="dropdown-menu">
				 {{if ModelExists('Wx')}}
				 	<li><?php echo $this->Html->link('<i class="fa fa-wechat"></i> 授权公众号', array('controller' => 'wxes','action'=>'mine','plugin' => null ,),array('target'=>'_blank','escape'=>false)); ?></li>
				 {{/if}}
				 	<li><?php echo $this->Html->link(__('<i class="fa fa-lock"></i> '.__('My Permissions')), array('controller' => 'users','action'=>'permission','plugin' => null ),array('target'=>'_blank','escape'=>false)); ?></li>
                    
				 	<li><?php echo $this->Html->link('<i class="fa fa-shopping-cart"></i> '.__('My Orders'), array('controller' => 'orders','action'=>'mine','plugin' => null ,),array('target'=>'_blank','escape'=>false)); ?></li>
                    <li><?php echo $this->Html->link(__('<i class="glyphicon glyphicon-map-marker"></i> '.__('My addresses')), array('controller' => 'orders','action'=>'order_consignee','plugin' => null ),array('escape'=>false)); ?></li>
                    <li><?php echo $this->Html->link('<i class="glyphicon glyphicon-user"></i> '.__('Edit Profile'), array('controller' => 'users','action'=>'edit','plugin' => null ,),array('escape'=>false,)); ?></li>
					<li><?php echo $this->Html->link('<i class="glyphicon glyphicon-asterisk"></i> '.__('Edit Password'), array('controller' => 'users','action'=>'editpassword','plugin' => null ,),array('escape'=>false)); ?></li>
                    
                    <!--     {{if (empty($CurrentUser['status']))}}
					<li class="activate link">
							{{eval echo $this->Html->link('<i class="fa fa-envelope"></i> '.__('Activate email'), array(
								'controller' => 'users', 'action' => 'activate'
								),array('target'=>'_blank','escape'=>false)); }}
					</li>
					{{/if}} 
					<li><?php echo $this->Html->link(__('<i class="fa fa-map-marker"></i> '.__('My addresses')), array('controller' => 'orders','action'=>'order_consignee','plugin' => null ),array('target'=>'_blank','escape'=>false)); ?></li>
                      -->   
                     <li><?php echo $this->Html->link(__('<i class="fa fa-leaf"></i> '.__('My Scores')), array('controller' => 'users','action'=>'score','plugin' => null ),array('target'=>'_blank','escape'=>false)); ?></li>
                      <li><?php echo $this->Html->link('<i class="fa fa-user"></i> '.__('My Invites'), array('controller' => 'users','action'=>'invite','plugin' => null ,),array('target'=>'_blank','escape'=>false)); ?></li>
					
                    <li>{{$this->Html->link('<i class="fa fa-sign-out"></i> '.__('Logout'), '/users/logout', array('title' => __('Logout'),'onclick'=>'clearUserCookie();','escape'=>false))}}</li> 
				</ul>
			</li>
	{{else}}
			<?php $oauthlogin = $this->Hook->call('oauthLoginLink'); ?>
			{{if $oauthlogin}}
				<li class="dropdown">
				{{eval echo $this->Html->link(__('Login').'<b class="caret"></b>', array(				
					'controller' => 'users', 'action' => 'login'				
				),array('onclick'=>"return checkLogin();","class"=>"dropdown-toggle","data-toggle"=>"dropdown",'escape'=>false)); }}
					<ul class="dropdown-menu">
						{{$oauthlogin}}	
					</ul>
				</li>
			{{else}}
				<li>
				{{eval echo $this->Html->link(__('Login'), array(				
					'controller' => 'users', 'action' => 'login'			
				),array(
					'onclick'=>"return publishController.open_dialog(this.href,{title:'".__('Login')."',selector:'#login-form',width:550});",
				)); }}
				</li>
			{{/if}}
			<li>
			{{eval echo $this->Html->link(__('Register'), array(
				'controller' => 'users', 'action' => 'register'
			),array(
					'target'=>'_blank',
			)); }}
			</li>
	{{/if}}
      </ul>

                            <!-- Navbar-Collapse -->
                            <div class="navbar-collapse collapse">
                            	  <?php 
		if(empty($top_category_id)) $top_category_id=0;
	echo $this->Section->getNavMenu('Category',
		array(
			'selectedid'=> $top_category_id,
			'ulAttributes'=>array('class'=>'nav navbar-nav navbar-right'),
                        'defaultClass'=>'ui-state-default',
			'preli'=>'',
			'sufli'=>'',
			'maxdepth' => 2,
			'target' => '_blank',
			'separator' => '',
			'inner_separator' => '',
		),$site_cate_id
	);
	?>
                            </div><!-- /End Navbar-Collapse -->
                        </div><!-- /End Col -->
                    </div><!-- /End Row -->
                </div><!-- /End Container -->
            </nav><!-- /End Sticky Navigation -->
    </header>

<div id="maincontent" class="maincontent clearfix" style="padding: 0 0;margin:36px auto;border: 1px solid #d9dadc;width: 1170px;"> 
	<div class="container">
		<div class="row">			
			<div class="col-sm-12" style="border-left: 1px solid #d9dadc;padding:13px 30px;min-height:180px;">
		    {{$content_for_layout}}
		    </div>
		</div>
	</div>
</div><!-- //end maincontent -->

{{template Elements/footer}}
